<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增发单商品')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-goods-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">游戏类型名称：</label>
                <div class="col-sm-8">
                    <input id="gameName" name="gameName" class="form-control" type="hidden" >
                    <select id="gameTYpe" name="gameType" class="form-control m-b" onchange="if(this.value){$('#gameName').val($(this).find('option:selected').text());
                    console.log($(this).find('option:selected').text());}"  th:with="type=${@dict.getType('dl_game_name')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">游戏区服：</label>
                <div class="col-sm-8">
                    <input name="gameArea" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">铭文等级：</label>
                <div class="col-sm-8">
                    <input name="inscriptionsNumber" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">英雄数量：</label>
                <div class="col-sm-8">
                    <input name="heroNumber" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">当前段位：</label>
                <div class="col-sm-8">
                    <input name="nowDan" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">目标段位：</label>
                <div class="col-sm-8">
                    <input name="targetDan" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">时限：</label>
                <div class="col-sm-8">
                    <input name="timeLimit" class="form-control" type="text" required>
                    <label class="">单位/小时</label>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">游戏账号：</label>
                <div class="col-sm-8">
                    <input name="gameUnumber" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">游戏密码：</label>
                <div class="col-sm-8">
                    <input name="gamePassward" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">英雄：</label>
                <div class="col-sm-8">
                    <input name="heroName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发单人  ：</label>
                <div class="col-sm-8">
                    <select name="userId" class="form-control m-b"  th:with="type=${userList}" required>
                        <option th:each="dict : ${type}" th:text="${dict.wxName}" th:value="${dict.id}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">价格：</label>
                <div class="col-sm-8">
                    <input name="orderPrice" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">保证金：</label>
                <div class="col-sm-8">
                    <input name="bzMoney" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">效率金：</label>
                <div class="col-sm-8">
                    <input name="xlMoney" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">代练要求：</label>
                <div class="col-sm-8">
                    <textarea name="requirements" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "dl/goods"
        $("#form-goods-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-goods-add').serialize());
            }
        }
    </script>
</body>
</html>